﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BitPortal.Models;
using BitPortal.Business;
using BitPortal.Utils;
using Ext.Net;
namespace BitPortal.Admin.Module.BaseModule.Module
{
    public partial class BaseModuleSelect : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack && !X.IsAjaxRequest)
            {
                BindData();
            }
        }
        protected void BindData()
        {
            Store1.DataSource = ModuleBLL.GetListSourceModules();
            Store1.DataBind();
        }
        protected void btnSetup_Click(object sender, DirectEventArgs e)
        {
            string test = "";
            foreach (SelectedRow row in ImageView.SelectedRows)
            {
                test += row.RecordID;
                //try
                //{

                //    X.Msg.Alert("tb", row.RecordID).Show();
                //    //ModuleBase mb = ModuleBLL.ReadBaseModuleConfig("~" + row.RecordID);
                //    //if (mb.Insert() > 0)
                //    //{
                //    //    Notification.Show(new NotificationConfig
                //    //    {
                //    //        Title = "Thông báo",
                //    //        Icon = Icon.Information,
                //    //        Html = "Thêm module thành công!"
                //    //    });
                //    //    //ResourceManager1.AddScript("parent.Ext.WindowMgr.getActive().hide();parent.Ext.getCmp('" + Request.QueryString["ReloadID"] + "').getStore().reload();");
                //    //}
                //}
                //catch
                //{

                //}
            }
            X.Msg.Alert("tb", test).Show();
        }

    }
}